<html>
<head><meta charset="utf-8"><title>function pointers · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function.20pointers.html">function pointers</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="146801921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function%20pointers/near/146801921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function.20pointers.html#146801921">(Nov 05 2018 at 15:14)</a>:</h4>
<p><span class="user-mention" data-user-id="125253">@Nicole Mazzuca</span> are you still planning on filling the function pointer issue in the repo ? I've found function types easy to use incorrectly in C FFI, to the point that I would prefer for them to not be appropriate C types, and require people to use <code>Option&lt;fn(...)-&gt;...&gt;</code>, <code>NonNull&lt;fn(...)-&gt;...&gt;</code> or just <code>*[const,mut] fn(...)-&gt;...</code> instead.</p>



<a name="146814321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function%20pointers/near/146814321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nicole Mazzuca <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function.20pointers.html#146814321">(Nov 05 2018 at 18:37)</a>:</h4>
<p>sorry, I did the thing</p>



<a name="146815728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function%20pointers/near/146815728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function.20pointers.html#146815728">(Nov 05 2018 at 18:58)</a>:</h4>
<p>Thank you!</p>



<a name="146815935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function%20pointers/near/146815935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function.20pointers.html#146815935">(Nov 05 2018 at 19:02)</a>:</h4>
<p><span class="user-mention" data-user-id="125253">@Nicole Mazzuca</span> so a <code>*mut fn()-&gt;()</code> is a raw pointer to a function pointer ?</p>



<a name="146816073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function%20pointers/near/146816073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function.20pointers.html#146816073">(Nov 05 2018 at 19:04)</a>:</h4>
<p>(deleted)</p>



<a name="146817825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function%20pointers/near/146817825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nicole Mazzuca <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function.20pointers.html#146817825">(Nov 05 2018 at 19:31)</a>:</h4>
<p>correct!</p>



<a name="146817843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function%20pointers/near/146817843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nicole Mazzuca <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/function.20pointers.html#146817843">(Nov 05 2018 at 19:31)</a>:</h4>
<p>(slightly unfortunately, imo, but it's true)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>